package com.guigu.qingcheng.systemservice.controller;


import com.guigu.qingcheng.systemservice.service.TbRoleResourceService;
import com.guigu.qingcheng.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author testjava
 * @since 2020-07-08
 */
@RestController
@RequestMapping("/systemservice/tb-role-resource")
public class TbRoleResourceController {
    @Autowired
    private TbRoleResourceService service;
    @GetMapping("/resource/findById")
    public List<Map> findById(@RequestParam("id") Integer id){
        List<Map> tbResource = service.getRoleResource(id);
        return tbResource;
    }

    @PostMapping("/resource/qxshzh")
    public R toResource(@RequestBody Map<String, Object> qxMap){
        Boolean f = service.toResource(qxMap);
        if(f){
            return R.ok();
        }
        return R.error();
    }
}

